package utils

import (
	"project2018/btc"
)

func CheckAddress(Symbol, Address string) bool {
	if Symbol == "ETH" {
		if len(Address) != 42 || Address[0:2] != "0x" {
			return false
		}
		return true
	} else if Symbol == "BTC" {
		ok, v, _ := btc.ValidateAddress([]byte(Address))
		if !(ok && (v == 0 || v == 5)) {
			return false
		}
		return true
	}
	return false
}
